# -*- coding: utf-8 -*-
import json
from SbyRequestUtil import SbyRequestUtil

# 签约
if __name__ == "__main__":
    dis = SbyRequestUtil()
    # 打开文件并读取内容
    with open('E:\\work\\test_1.png', 'rb') as file2:
        content2 = file2.read()
        hex_content2 = content2.hex()
    idCardPic2 = hex_content2

    with open('E:\\work\\test.png', 'rb') as file1:
        content = file1.read()
        hex_content = content.hex()
    idCardPic1 = hex_content



# 将二进制数据转换为十六进制字符串

    data = {
             "name":"刘鹏",
             "cardNo":"6223097918608494729",
             "idCard":"513326200406012749",
             "mobile":"13534473571",
             "paymentType":0,
             "providerId":30481,
             "idCardPic1":idCardPic1,
              "idCardPic2":idCardPic2,
              "otherParam":"6010",
             "notifyUrl":"http://www.baidu.com/",
    }
    dis.applyByHttpPost("6010",json.dumps(data))